<%-- 
    Document   : checkajax
    Created on : Mar 23, 2012, 3:58:58 PM
    Author     : Yasmani
--%>

<%@ page import="java.sql.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" 
    prefix="c" %>
<%
String name = request.getParameter("username").toString();
System.out.println(name);
String data ="";
try{
           Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/ismi", "root", "isaac16");
           Statement st=con.createStatement();
           ResultSet rs=st.executeQuery("select * from user where user_name='"+name+"'");
int count=0;
          while(rs.next())
          {

                   count++;
          }

                    if(count>0)
          { 
                       
          data = "Not Available";
         
          }
        
          else
          { 
          data = "Available" ;
          }
out.println(data);
System.out.println(data);
}
catch (Exception e) {
System.out.println(e);
}
%>
